import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import(/* webpackChunkName: "introduce" */ '../views/HomeView.vue'),
    children: [
      {
        path: 'chat',
        name: 'chat',
        component: () => import(/* webpackChunkName: "introduce" */ '../views/ChatView.vue'),
        meta: { keepAlive: true }
      },
      {
        path: 'sd',
        name: 'sd',
        component: () => import(/* webpackChunkName: "introduce" */ '../views/SDView.vue'),
        meta: { keepAlive: true }
      },
      {
        path: 'storyboard',
        name: 'storyboard',
        component: () => import(/* webpackChunkName: "storyboard" */ '../views/StoryboardView.vue'),
        meta: { keepAlive: true }
      },
      {
        path: 'text-polish',
        name: 'text-polish',
        component: () => import(/* webpackChunkName: "text-polish" */ '../views/TextPolishView.vue'),
        meta: { keepAlive: true }
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
